//
//  FQEditViewController.m
//  WeChat
//
//  Created by 方桥 on 16/5/16.
//  Copyright © 2016年 方桥. All rights reserved.
//

#import "FQEditViewController.h"

@interface FQEditViewController ()
@property (weak, nonatomic) IBOutlet UITextField *TextField;

@end

@implementation FQEditViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    //设置标题
    self.title = _cell.textLabel.text;
    //设置输入框默认数值
    self.TextField.text = _cell.detailTextLabel.text;
}

- (IBAction)saveBtnClick:(id)sender {
    //1.把cell的detailTextLabel的值更改
    self.cell.detailTextLabel.text = self.TextField.text;
    [self.cell layoutSubviews];
    //2.当前控制器销毁
    [self.navigationController popViewControllerAnimated:YES];
    //3.通过上一个控制器保存到服务器
    if ([self.delegate respondsToSelector:@selector(editViewController:didFinishSave:)]) {
        [self.delegate editViewController:self didFinishSave:sender];
    }
}





@end
